package cn.gao.enums.child;

import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;
import java.util.concurrent.atomic.AtomicBoolean;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: GaoXu
 * @Date: 2022/05/20/15:18
 * @Description:
 */
public enum ExeTypeEnum {

    EXE("exe"),
    BAT("bat"),
    ISO("iso"),
    SH("sh"),
    MSI("msi"),
    ;

    private String typeName;

    ExeTypeEnum (String typeName){
        this.typeName = typeName;
    }

    public static boolean contains(String type){
        AtomicBoolean flag = new AtomicBoolean(false);
        Arrays.stream(ExeTypeEnum.values()).forEach(e->{
                if (StringUtils.equals(type,e.typeName)){
                    flag.set(true);
                }
        });
        return flag.get();
    }

}
